//
//  BalanceViewController.m
//  JackDeve
//
//  Created by apple on 17/5/9.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "BalanceViewController.h"

@interface BalanceViewController ()

@end

@implementation BalanceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"余额";
    self.view = [[BalanceView alloc]initWithFrame:self.view.bounds];
    
    //创建一个添加按钮
    UIButton *navLeftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 5, 20, 20)];
    [navLeftBtn setBackgroundImage:[UIImage imageNamed:@"左箭头"] forState:UIControlStateNormal];
    [navLeftBtn addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:navLeftBtn];
    
    UIButton *btnRight = [[UIButton alloc]initWithFrame:CGRectMake(0, 5, 100, 20)];
    [btnRight setTitle:@"余额明细" forState:UIControlStateNormal];
    [btnRight setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btnRight addTarget:self action:@selector(Right) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem * btn =[[UIBarButtonItem alloc]initWithCustomView:btnRight];
    UIBarButtonItem * neg = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
    neg.width =-20;
    //调动位置
    self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:neg,btn,nil];
    
   
    
}

//余额界面
-(void)Right{
    [self.navigationController pushViewController:[SDYuEViewController new] animated:YES];
}

-(void)back{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
